//
//  DiskSize.cpp
//  WatermarkCamera
//
//  Created by AxcLogo on 4/7/2024.
//

#include "DiskSize.hpp"

/// 获取硬盘空间大小
unsigned long long GetFreeDiskSpace(){
    struct statfs buf;
    unsigned long long freeSpace = 0;
    
    if (statfs("/", &buf) >= 0) {
        freeSpace = (unsigned long long)(buf.f_bsize * buf.f_bfree);
    }
    
    return freeSpace;
}
